package com.aaa.controller;

import com.aaa.entity.MyReturn;
import com.aaa.entity.PageSort;
import com.aaa.service.LogService;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Version 1.0
 * @Author:w
 * @Date:Created in 2022/7/15
 * @Content:
 * @Description:
 * @Version:
 */
@Controller
@RequestMapping("log")
public class LogController {
    @Autowired
    private LogService logService;
    MyReturn myReturn=new MyReturn();

    @RequestMapping("toShowLog.do")
    public String toShowLog() {
        return "showLog";
    }

    @RequestMapping("findAllLog.do")
    @ResponseBody
    public MyReturn findAllLog(PageSort pageSort) {
        Page page = logService.findAll(pageSort);
        myReturn.setData(page);
        myReturn.setCount(page.getTotal());
        return myReturn;
    }
}
